﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UserListJson.ascx.cs" Inherits="DMS.Web.Common.Controls.UserListJson" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="diy" %>
<style type="text/css">
    #chkSelector, #radSelector
    {
        border-width: 0px;
    }
</style>

    <ContentTemplate>
        <%--搜索栏--%>
        <div id="dvSearch" runat="server" class="search">
            <!----------- 查询信息 ------------------>
            <table width="100%" cellpadding="0" cellspacing="0">
                <tr>
                    <td class="ico">
                        <a href="javascript:changeView('1')">
                            <img src="/themes/default/ico_have.gif" id="ico_1" border="0"></a>
                    </td>
                    <td class="form">
                        <table cellpadding="0" cellspacing="0" width="100%">
                            <tr>
                                <th style="width:30px">
                                    <nobr>
                                        姓名：
                                    </nobr>
                                </th>
                                <td>
                                    <asp:TextBox ID="txtUserName" runat="server" Width="55px"></asp:TextBox>
                                </td>
                                <th>
                                    <nobr>
                                        登录帐号：
                                    </nobr>
                                </th>
                                <td>
                                    <asp:TextBox ID="txtLoginID" runat="server" Width="80px"></asp:TextBox>
                                </td>
                                <th>
                                    <nobr>
                                        所属部门：
                                    </nobr>
                                </th>
                                <td>
                                    <nobr>
                                        <asp:TextBox ID="txtDeptName" runat="server" Width="80px" ReadOnly="true" ToolTip="请在左侧组织架构中选择"></asp:TextBox>
                                        <input type="hidden" id="hidDeptID" runat="server" />
                                        <img id="imgSelectDept" runat="server" CanDisplay="NoDisplay" title="选择部门" src="/Resources/Images/icon_dept.gif" onclick="javascript:" />
                                    </nobr>
                                </td>
                                <td class="button" colspan=2 style="width:180px">
                                    <div style="float:right">
                                        <asp:LinkButton ID="btnQuery" CssClass="linkbtn" runat="server" OnClick="btnQuery_Click"><span>查&nbsp;询</span></asp:LinkButton>
                                        <asp:LinkButton ID="btnSync" CssClass="linkbtn" runat="server" OnClick="btnSync_Click" OnClientClick="javascript:return Warming();" ><span>同&nbsp;步</span></asp:LinkButton>
                                        <asp:LinkButton ID="expBtn" CssClass="linkbtn" runat="server" OnClick="BtnExp_Click"><span>导&nbsp;出</span></asp:LinkButton>   
                                   </div>
                                </td>
                            </tr>
                            <tbody id="div_1" style="display: none; border: 0px;">
                                <tr>
                                    <th>
                                        <nobr>
                                            性别：
                                        </nobr>
                                    </th>
                                    <td>
                                        <asp:DropDownList ID="ddlSex" runat="server" Width="65px">
                                            <asp:ListItem Value="1" Text="男"></asp:ListItem>
                                            <asp:ListItem Value="2" Text="女"></asp:ListItem>
                                            <asp:ListItem Value="3" Text="未知"></asp:ListItem>
                                            <asp:ListItem Value="ALL" Text="不限" Selected="True"></asp:ListItem>
                                        </asp:DropDownList>
                                    </td>
                                    <th>
                                        <nobr>
                                            移动电话：
                                        </nobr>
                                    </th>
                                    <td>
                                        <asp:TextBox ID="txtMobile" runat="server" Width="80px"></asp:TextBox>
                                    </td>
                                    <th>
                                        <nobr>
                                            含子部门：
                                        </nobr>
                                    </th>
                                    <td>
                                        <asp:DropDownList ID="ddlContainSub" runat="server" Width="85px">
                                            <asp:ListItem Value="1" Text="包括" Selected="True"></asp:ListItem>
                                            <asp:ListItem Value="0" Text="不包括"></asp:ListItem>
                                        </asp:DropDownList>
                                    </td>
                                    <td align="left" colspan="2">
                                        <nobr>
                                            临时用户：
                                            <asp:DropDownList ID="ddlTempUser" runat="server" Width="50px">
                                                <asp:ListItem Value="1" Text="包括" Selected="True"></asp:ListItem>
                                                <asp:ListItem Value="0" Text="不包括"></asp:ListItem>
                                            </asp:DropDownList>
                                        </nobr>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </td>
                </tr>
            </table>
        </div>
        <%--数据列表--%>
        <asp:DataGrid ID="dgUserList" runat="server" AutoGenerateColumns="false" Width="100%"
            CssClass="dg_borderstyle" OnItemDataBound="dgUserList_ItemDataBound">
            <HeaderStyle HorizontalAlign="Center" />
            <ItemStyle CssClass="dg_itemstyle" />
            <AlternatingItemStyle CssClass="dg_alternatingitemstyle" />
            <Columns>
                <asp:TemplateColumn HeaderText="多选" Visible="false">
                    <ItemStyle Width="30px" HorizontalAlign="Center" />
                    <HeaderTemplate>
                        <a id="selectAllLink" href="javascript:" title="点击“全选”或“取消全选”" onclick="javascrpt:SelectAll(this, 'chkSelector');"
                            statue="false" style="cursor: pointer;">全选</a>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <input type="checkbox" id="chkSelector" name="chkSelector" value="<%#Eval("ID") %>" onchange="javascript:return;UpdateChkStatue(this, 'selectAllLink');" />
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn HeaderText="单选" Visible="false">
                    <ItemStyle Width="30px" HorizontalAlign="Center" />
                    <HeaderTemplate>
                        选择
                    </HeaderTemplate>
                    <ItemTemplate>
                        <input type="radio" id="radSelector" name="radSelector" value="<%#Eval("ID") %>" onclick="javascript:Clear();AddItem('<%#Eval("Name") %>（<asp:Literal ID="ltlDeptFullName" runat="server"></asp:Literal>）','{\'Type\':\'<%#Eval("ActorType") %>\',\'ID\':\'<%#Eval("ID") %>\',\'LoginID\':\'<%#Eval("LoginID") %>\',\'Name\':\'<%#Eval("Name") %>\',\'DeptID\':\'<%#Eval("Dept.ID") %>\',\'DeptName\':\'<%#Eval("Dept.Name") %>\',\'BigDeptID\':\'<%#Eval("BigDept.ID")%>\',\'BigDeptName\':\'<%#Eval("BigDept.Name")%>\',\'Mobile\':\'<%#Eval("Mobile") %>\'}');" />
                        
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn HeaderText="姓名">
                    <ItemStyle Width="100px" />
                    <ItemTemplate>
                        <div title="<%#Eval("Name") %>" style="overflow: hidden; text-overflow: ellipsis; width: 100px;">
                            <nobr>
                                <%#Eval("Name") %>
                            </nobr>
                        </div>
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn HeaderText="登录帐号">
                    <ItemStyle Width="100px" />
                    <ItemTemplate>
                        <div title="<%#Eval("LoginID") %>" style="overflow: hidden; text-overflow: ellipsis; width: 100px;">
                            <nobr>
                                <%#Eval("LoginID") %>
                            </nobr>
                        </div>
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn HeaderText="性别">
                    <ItemStyle Width="50px" HorizontalAlign="Center" />
                    <ItemTemplate>
                        <div style="overflow: hidden; text-overflow: ellipsis; width: 50px;">
                            <nobr>
                                <asp:Label ID="labUserSex" runat="server"></asp:Label>
                            </nobr>
                        </div>
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn HeaderText="所属部门">
                    <ItemStyle Width="150px" />
                    <ItemTemplate>
                        <div style="overflow: hidden; text-overflow: ellipsis; width: 150px;">
                            <nobr>
                                <asp:Label ID="labUserDept" runat="server"></asp:Label>
                            </nobr>
                        </div>
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn HeaderText="移动电话">
                    <ItemStyle Width="85px" HorizontalAlign="Center" />
                    <ItemTemplate>
                        <div title="<%#Eval("Mobile")%>" style="overflow: hidden; text-overflow: ellipsis; width: 85px;">
                            <nobr>
                                <%#Eval("Mobile")%>
                            </nobr>
                        </div>
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn HeaderText="操作">
                    <ItemTemplate>
                        <nobr>
                            <img alt="角色设置" title="角色设置" src="/Resources/Images/icon_role.gif" onclick="javascript:OpenUserRoleSetting(this, '<%#Eval("ID") %>', 'User');" style="cursor:hand;" />
                        </nobr>
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn HeaderText="操作">
                    <ItemStyle HorizontalAlign="Center" />
                    <ItemTemplate>
                        <nobr>
                            <a id="lkSelectBtn" runat="server" href="javascript:">选择</a>
                        </nobr>
                    </ItemTemplate>
                </asp:TemplateColumn>
            </Columns>
        </asp:DataGrid>
        <div id="dvPager" class="PagerHolder">
        <diy:AspNetPager ID="pager" runat="server" AlwaysShow="true" OnPageChanged="pager_PageChanged"
            Width="100%" ShowPageIndexBox="Always" PageIndexBoxType="TextBox" TextBeforePageIndexBox="转到"
            TextAfterPageIndexBox="页" ShowCustomInfoSection="Left" CustomInfoHTML="总数：%RecordCount%，共 %PageCount% 页，当前为第%CurrentPageIndex%页"
            HorizontalAlign="right" FirstPageText="首页" PrevPageText="上页" NextPageText="下页"
            LastPageText="末页" CssClass="dg_pagestyle">
        </diy:AspNetPager>
        </div>
        <div id="dvEmpty" runat="server" class="EmptyMsg" visible="false">
            没有查询到相应的用户信息。
        </div>
        <asp:ListBox ID="lbGridColState" runat="server" Visible="false">
            <asp:ListItem Value="SingleSelector">1</asp:ListItem>
            <asp:ListItem Value="Management">7</asp:ListItem>
            <asp:ListItem Value="MutilSelector">8</asp:ListItem>
        </asp:ListBox>
    </ContentTemplate>
    <Triggers>
        <asp:PostBackTrigger ControlID="btnSync" />
    </Triggers>
<script language="javascript" type="text/javascript">
<!--
    function Warming() {
        return window.confirm("用户同步操作需要较长，是否继续?");
    }
//-->
</script>